package
{
	import org.flixel.*; //Get access to all the wonders flixel has to offer

	public class EndState extends FlxState		//The class declaration for the main game state
	{
		protected var _winner:Boolean = true;

		public function EndState(isWinner:Boolean){
			_winner = isWinner;
		}
		
		override public function create():void
		{
			var i:int;
			
			var text:String = "WINNER!";
			if(!_winner){
				text = "YOU LOOSE!!!";
			}
			var t:FlxText = new FlxText(4,4,FlxG.width-8,text);
			t.alignment = "center";
			add(t);
			
			var t2:FlxText = new FlxText(4,(FlxG.height / 2) - 4,FlxG.width-8,"Click to continue...");
			t2.alignment = "center";
			add(t2);
			
			FlxG.mouse.show();
		}
		
		override public function update():void
		{
			if(FlxG.mouse.justPressed()) {
				FlxG.mouse.hide();
				FlxG.state = new SplashState();	
				return;	
			}
			
		}

	
		
		
	}
}
